<?php include($folder.'/layouts/templates/backend/header.tpl') ?>
<?php
$master['action'] = null;
$master['attributes'] = null;
$master['pageTitle'] = 'Ünnepsoroló';
$master['toolbarItems'] = array(
	'<input type="button" onclick="javascript:location.href=\''.$prefix.'/adminisztracio/unnepek/modositas\'" value="Hozzáadás" class="button" />',
	'<input type="button" value="Vissza" class="button" onclick="javascript:window.location.href=\''.$prefix.'/adminisztracio\'" />'
);
?>
<script type="text/javascript">
function FeastDelete(feastID)
{
	if (confirm('Biztos, hogy törölni szeretnéd?'))
	{
		SubmitForm('feast_delete', {'feastToDelete':feastID})
	}
}
</script>
<?php include($folder.'/layouts/templates/backend/middle.tpl') ?>
<?php if (!empty($_SESSION['id'])): ?>
<input type="hidden" name="feastToDelete" id="feastToDelete" />
<?php $content['itemsPerPage'] = 14 ?>
<?php echo extendedTable(array(
	'header' => paginator(array(
		'selectCountMethod' => 'unnepek_select_count',
		'id' => 'main',
		'itemsPerPageAll' => array(7, 14, 28, 56),
		'itemsPerPage' => $content['itemsPerPage'])),
	'body' => table(array(
		'id' => 'main',
		'block' => 0,
		'selectMethod' => 'unnepek_select',
		'columns' => array(
			array('title'=>'hónap', 'template'=>'{month_name}', 'width'=>'', 'align'=>'left', 'sortColumn'=>'month_id'),
			array('title'=>'nap', 'template'=>'{dayofmonth}', 'width'=>'', 'align'=>'left', 'sortColumn'=>''),
			array('title'=>'megnevezés', 'template'=>'{name}', 'width'=>'', 'align'=>'left', 'sortColumn'=>'name'),
			array('title'=>'művelet', 
				'template'=>'
				<a href="'.$prefix.'/adminisztracio/unnepek/modositas?id={id}">módosítás</a>
				<a href="javascript:FeastDelete({id})">törlés</a>', 
				'width'=>'', 'align'=>'left', 'sortColumn'=>'')
		),
		'itemsPerPage' => $content['itemsPerPage'],
		'sortColumn' => 'month_id',
		'sortDirection' => 'asc')),
	'footer' => paginator(array(
		'selectCountMethod' => 'unnepek_select_count',
		'id' => 'main',
		'itemsPerPageAll' => array(7, 14, 28, 56),
		'itemsPerPage' => $content['itemsPerPage'])))) ?>
<?php endif; ?>
<?php include($folder.'/layouts/templates/backend/footer.tpl') ?>